﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;

/// <summary>
/// Summary description for LOG_ChinhSachHeThong
/// </summary>
public class LOG_ChinhSachHeThong
{
	public LOG_ChinhSachHeThong()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public string TaiKhoan { get; set; }
    public string Policy { get; set; }
    public string PC { get; set; }
    public string IP { get; set; }
    public string ThoiGian { get; set; }

    public int LOG_ChinhSachHeThong_Insert()
    {
        string procName = "LOG_ChinhSachHeThong_Insert";
        DataService ds = new DataService();
        ds.Connect();
        SqlParameter[] parameters = new SqlParameter[5];
        parameters[0] = new SqlParameter("@TaiKhoan", TaiKhoan);
        parameters[1] = new SqlParameter("@Policy", Policy);
        parameters[2] = new SqlParameter("@PC", PC);
        parameters[3] = new SqlParameter("@IP", IP);
        parameters[4] = new SqlParameter("@ThoiGian", DateTime.Now);
        int i = ds.ExcuteProcedureWithReturn(procName, parameters);
        return i;
    }
    public DataTable LOG_ChinhSachHeThong_GetList()
    {
        string proName = "LOG_ChinhSachHeThong_GetList";
        DataService ds = new DataService();
        ds.Connect();
        DataTable table = ds.ExcuteProcedureGetTable(proName,null);
        ds.Disconnect();
        return table;
    }
    public int LOG_Online_Insert()
    {
        string procName = "LOG_Online_Insert";
        DataService ds = new DataService();
        ds.Connect();
        SqlParameter[] parameters = new SqlParameter[3];
        parameters[0] = new SqlParameter("@TaiKhoan", TaiKhoan);       
        parameters[1] = new SqlParameter("@PC", PC);
        parameters[2] = new SqlParameter("@IP", IP);        
        int i = ds.ExcuteProcedureWithReturn(procName, parameters);
        return i;
    }
}